package nl.twleaks.alice.task;

import com.google.appengine.api.taskqueue.Queue;
import com.google.appengine.api.taskqueue.QueueFactory;
import static com.google.appengine.api.taskqueue.TaskOptions.Builder.*;

public class TaskWaitlist {
	public static void waitForNewTask(int time) {
		if(time > 0) {
			Queue queue = QueueFactory.getDefaultQueue();
			queue.add(withCountdownMillis(time).url("/invoketask"));
		} else {
			TaskWaitlist.lookForNewTask();
		}
	}
	
	public static void lookForNewTask() {
	}
}
